package com.app.order.impl;

import com.app.common.entity.Order;
import com.app.common.service.OrderService;
import com.app.order.dao.OrderMapper;
import com.xhga.transaction.common.annotation.XHGATransaction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.*;

/**
 * Created by HuaWeiBo on 2019/4/10.
 */
@Service("orderService")
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;

    @XHGATransaction(type = "test", names = {"account","order"}, name = "order", serverCount = 2)
    @Override
    public int addOrder(Order order) throws Exception {
        int i = orderMapper.insertSelective(order);
        System.out.println("添加order状态:" +i);
        return i;
    }

}
